package com.wenan.ui.grids
{
	import mx.controls.listClasses.IListItemRenderer;
	
	import spark.components.Label;

	public class DataReportNameItemRender extends Label implements IListItemRenderer
	{
		private var _column:DateReportNameColumn;
		private var _data:Object = null;
		
		public function DataReportNameItemRender()
		{
			super();
			
			setStyle("verticalAlign", "middle");
			setStyle("paddingLeft", "8");
		}
		
		public function get column():DateReportNameColumn
		{
			return _column;
		}
		
		public function set column(value:DateReportNameColumn):void
		{
			_column = value;
		}
		
		public function get data():Object
		{
			return _data;
		}
		
		/**
		 * 初始化数据（增加列、dataField发生变化等操作）时，同步控件。
		 */
		public function set data(value:Object):void
		{
			_data = value;
			
			if (_data != null)
			{
				this.text =  _data[_column.dataField];
				
				setStyle("backgroundColor", "#FAFD01");	
			}
		} 
	}
}